package cn.oop.inherit;

/*
 * 测试继承
 */
public class Animal {
    String eye;
    String foot;

    public void Run() {
        System.out.println("跑!");
    }

    public void Eat() {
        System.out.println("吃！");
    }

    public void sleep() {
        System.out.println("zzzzz");
    }

    public Animal() {
        super();
        System.out.println("建一只鸟");
    }
}

class Mammal extends Animal {
    public void taisheng() {
        super.Run();
        this.Run();
        System.out.println("胎生");
    }
}

class bird extends Animal {
    public void Run() {
        System.out.println("我是一只小小鸟,想要飞却怎么样也非不高");
    }

    public void eggsheng() {
        System.out.println("卵生!");
    }
}

class Cat extends cn.oop.polymorphism.Animal {
    public void voice() {
        System.out.println("喵喵喵");
    }
}